package com.wz.sort;

public class BubbleSort {

	public static int[] sort(int... params){
		int[] myParms = params;
		for (int outer = params.length; outer > 1; outer--) {
			for (int inner = 0; inner < myParms.length - 1; inner++) {
				if (myParms[inner] > myParms[inner+1]){
					int tmpNum = myParms[inner];
					myParms[inner] = myParms[inner+1];
					myParms[inner+1] = tmpNum;
				}
			}
		}
		return myParms;
	}

	public static void main(String[] args) {
		int[] a = BubbleSort.sort(new int[]{1,4,8,7,6,44,358,112,0,-8});
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i]+":");
		}
		System.out.println("");
	}
}